import React from "react";
import C from "./C";
//导入 PubSub 
import PubSub from "pubsub-js";
export default function B(props) {
  return (
    <div>
      <input type="text" />
      <button onClick={(e) => {
        //发布新的消息
        PubSub.publish('msg', e.target.previousSibling.value); //publish 发布
      }}>发送</button>
    </div>
  );
}
